package com.davidhigenbottam.HeatMap.server;

import com.davidhigenbottam.HeatMap.data.Data;
import com.davidhigenbottam.HeatMap.data.GrossEnrollmentRatioProvinceData;
import com.davidhigenbottam.HeatMap.data.NetEnrollmentRatioProvinceData;
import com.davidhigenbottam.HeatMap.data.HigherEducationEnrolementProvinceData;
import com.davidhigenbottam.HeatMap.data.SchoolEnrollmentRatioProvinceData;
import com.davidhigenbottam.HeatMap.data.StaffWithPhdProvinceData;
import com.davidhigenbottam.HeatMap.shared.Query;

public class InstitutionDataFactory {

	public static Data createProvinceData(Query query, boolean localMode){
		Data provinceData;
		if(query.isHEEnrolement())
			provinceData = new HigherEducationEnrolementProvinceData(query);
		else if(query.isStaffWithPhd())
			provinceData = new StaffWithPhdProvinceData(query);
		else if(query.isSchoolEnrollmentRatio())
			provinceData = new SchoolEnrollmentRatioProvinceData(query);
		else if(query.isGrossEnrollmentRatio())
			provinceData = new GrossEnrollmentRatioProvinceData(query);
		else if(query.isNetEnrollmentRatio())
			provinceData = new NetEnrollmentRatioProvinceData(query);
		else
			throw new RuntimeException("Undefined data source");
		
		return provinceData;
	}
	
}
